<%@ page contentType="text/html;charset=utf-8" errorPage="error.jsp"%>
<%@ page import="java.util.ArrayList"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>搜索 -</TITLE>
<LINK href="styles/green/ejforum.css" type=text/css rel=stylesheet>
</HEAD>
<BODY onkeydown="if(event.keyCode==27) return false;" onload="clickgoogle()">
<SCRIPT src="js/common.js" type=text/javascript></SCRIPT>
<DIV class=wrap>
<DIV id=header>
</DIV>
<DIV id=nav><A href=""></A> &raquo;&nbsp; 论坛搜索</DIV>
<FORM id=frmsearch action="search_result.jsp" method=post onsubmit="return validate(this)">
<DIV class="mainbox formbox">
<H1>论坛搜索</H1>
<TABLE cellSpacing=0 cellPadding=0>
  <TBODY>
  <TR>
    <TH width="10%">搜索方式</TH>
    <TD width="40%">
	  <LABEL><INPUT onclick="clickgoogle()" type=radio CHECKED value=google name=searchfield 
	  			id="searchfield_google"> Google 搜索</LABEL> 
	  <LABEL><INPUT onclick="clickgoogle()" type=radio value=title name=searchfield
	  			id="searchfield_title"> 标题搜索</LABEL> 
	  <LABEL><INPUT onclick="clickgoogle()" type=radio value=content name=searchfield
	  			id="searchfield_content"> 全文搜索（主题+回复）</LABEL> </TD>
	 <TD width="50%">最新的主题可能不会被搜索到</TD></TR></TBODY>
  <TBODY>
  <TR>
    <TH><LABEL for=keys>关键字</LABEL></TH>
    <TD><INPUT id=keys maxLength=50 size=60 name=keys></TD>
    <TD>多个关键字之间请用空格或逗号分隔, 比如&nbsp;"科幻 小说"&nbsp;表示同时包含这两个关键字</TD></TR></TBODY>
  <TBODY id=notgoogle1>
  <TR>
    <TH><LABEL for=uid>用户名</LABEL></TH>
    <TD><INPUT id=uid maxLength=50 size=60 name=uid></TD>
    <TD>用户名或用户昵称</TD></TR></TBODY>
  <TBODY id=notgoogle2>
  <TR>
    <TD vAlign=top><LABEL for=boardid>搜索范围</LABEL></TD>
    <TD>
	  <SELECT id=boardid style="width: 335px" name=boardid> 
	    <OPTION value="" selected>所有版块</OPTION> 
		<OPTION value="">&nbsp;</OPTION> 
	  </SELECT></TD>
	<TD>&nbsp;</TD></TR></TBODY>
  <TBODY>
  <TR class="btns">
    <TH>&nbsp;</TH>
    <TD height="30"><BUTTON class=submit name=searchsubmit type=submit>搜索</BUTTON></TD>
	<TD>&nbsp;</TD></TR></TBODY></TABLE></DIV></FORM>
<SCRIPT type=text/javascript>
function validate(theform) {
	if (trim(theform.keys.value) == '') {
		alert("请输入搜索关键字");
		theform.keys.focus();
		return false;
	}
	if($('searchfield_google').checked) {
		window.open("http://www.google.cn/search?ie=GB2312&oe=GB2312&hl=zh-CN&sitesearch="
       	         	+ "&q=" + trim(theform.keys.value));
		return false;
	}
	return true;
}
function clickgoogle() {
	if($('searchfield_google').checked) {
		$('notgoogle1').style.display = 'none';
		$('notgoogle2').style.display = 'none';
	} else {
		$('notgoogle1').style.display = '';
		$('notgoogle2').style.display = '';
	}
}
</SCRIPT>
</DIV>
</BODY></HTML>
